<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="test">
        <div>1年龄：{{age}}  </div>
        <button v-on:click="test1">点我age+1</button>
        <button @click="test2">点我age+1</button>
        <button @click="test3(11)">点我age+11</button>
    </div>
</body>
</html>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    let vue = new Vue({
        el:"#test",
        data:{
            age:18
        },
        methods:{
            test1:function() {
                this.age++
            },
            test2() {
                this.age++
            },
            test3(count) {
                this.age += count;
            }
        }
    });
    console.log(vue)
</script>